package com.rbac.web.model;

import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author gengaoliu
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PageResult<T> {
  private Long page;
  private Long size;
  private Long total;
  private List<T> list;

  public static <T> PageResult<T> of(long current, long size, long total, List<T> collect) {
    return new PageResult<>(current, size, total, collect);
  }

  public static <T> PageResult<T> empty() {
    return new PageResult<>(0L, 0L, 0L, null);
  }
}
